home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2718 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: news.mel.aone.net.au!usenet
  2. From: clyde@hitech.com.au (Clyde Smith-Stubbs)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: IEEE Format
  5. Date: Tue, 23 Jan 1996 12:02:25 GMT
  6. Organization: HI-TECH Software
  7. Message-ID: <3104ce13.194969792@news.bne.aone.net.au>
  8. References: <4e2bk7$qol@oznet07.ozemail.com.au>
  9. Reply-To: clyde@hitech.com.au
  10. NNTP-Posting-Host: skyhawk.hitech.com.au
  11. X-Newsreader: Forte Agent .99c/16.141
  12.  
  13. On 23 Jan 1996 10:00:39 GMT, Mark Richter <mrichter@ozemail.com.au>
  14. wrote:
  15.  
  16. >I am having difficulty with floating point precesion within a Borlamd C++ 
  17. >4.5.  Borland uses the international IEEE format to provide it's floating 
  18. >point arithmetic but failed to supply any documentation aa what it 
  19. >actually is.  I was hoping someone may be able to help me with the 
  20. >bit/byte layout of this standard ?
  21.  
  22. ;       The format of floating point numbers is as follows:
  23.  
  24. ;       -----------------
  25. ;       *   mantissa    *  23 bits + 1 implied bit = 24 bits
  26. ;       -----------------
  27. ;       *   exponent    *  8 bits
  28. ;       -----------------
  29. ;       *     sign      *  1 bit
  30. ;       -----------------
  31.  
  32. ;       Double floating point is as follows:    
  33.  
  34. ;       -----------------
  35. ;       *   mantissa    *  52 bits + 1 implied bit = 53 bits
  36. ;       -----------------
  37. ;       *   exponent    *  11 bits
  38. ;       -----------------
  39. ;       *     sign      *  1 bit
  40. ;       -----------------
  41.  
  42. ;       The implied bit is always 1 except for a zero value where it
  43. is
  44. ;       zero. A zero value is indicated by a zero exponent. The
  45. exponent
  46. ;       for a float is stored as excess 127 (i.e. an exponent of 0 is
  47. ;       represented by 127) and for a double as excess 1023. The
  48. mantissa
  49. ;       is in positive magnitude form.
  50.  
  51. ----
  52.  Clyde Smith-Stubbs       | HI-TECH Software,       | Voice: +61 7 3300 5011
  53.  clyde@hitech.com.au      | P.O. Box 103, Alderley, | Fax:   +61 7 3300 5246
  54. http://www.hitech.com.au  | QLD, 4051, AUSTRALIA.   | BBS:   +61 7 3300 5235
  55. ----------------------------------------------------------------------------
  56. FREE! Download our shareware (FREE for noncommercial use) MS-DOS C Compiler!
  57.              Point your Web browser at http://www.hitech.com.au/
  58.